﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class playerCtrl : MonoBehaviour {

	private Animator anim;
	// Use this for initialization
	void Start () {
		anim = GetComponent<Animator>(); 
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKey(KeyCode.UpArrow) ||
		Input.GetKey(KeyCode.DownArrow) ||
		Input.GetKey(KeyCode.LeftArrow) ||
		Input.GetKey(KeyCode.RightArrow))
        {
            anim.SetBool("isMoving", true);
        }
		else
		{
			anim.SetBool("isMoving", false);
		}
		if (Input.GetKey(KeyCode.LeftShift))
        {
            anim.SetBool("isRun", true);
        }
		else
		{
			anim.SetBool("isRun", false);
		}
		if (Input.GetKey(KeyCode.LeftControl))
        {
            anim.SetBool("isInWater", true);
        }
		else
		{
			anim.SetBool("isInWater", false);
		}
	}
}
